import { IsNotEmpty, IsString, IsOptional } from 'class-validator';
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';

export class LoginDto {
  @ApiProperty({
    description: 'User email address',
    example: 'user@example.com',
  })
  @IsNotEmpty()
  @IsString()
  username: string;

  @ApiProperty({
    description: 'User password',
    example: 'Password123',
  })
  @IsNotEmpty()
  @IsString()
  password: string;

  @ApiProperty({
    description: 'Device serial number',
    example: 'DEVICE-123456',
  })
  @IsOptional()
  @IsString()
  deviceSerialNumber?: string;

  @ApiPropertyOptional({
    description: 'Unique device identifier (deprecated, use deviceSerialNumber instead)',
    example: 'device-123456',
    deprecated: true,
  })
  @IsOptional()
  @IsString()
  deviceId?: string;
}
